package com.openweixin.sheknows.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 实体类-专家信息
 * 
 * @注意事项 无
 * @author 刘思作
 * @version 1.0.0 2014-04-02
 * @since 1.0.0
 */

@Entity
@Table(name = "expert")
public class Expert {

	private Integer uid;//
	private Short level;// 等级
	private Integer score;// 总的评分
	private Integer scoretimes;// 评分次数

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "uid")
	public Integer getUid() {
		return this.uid;
	}

	public void setUid(Integer uid) {
		this.uid = uid;
	}

	@Column(name = "level")
	public Short getLevel() {
		return this.level;
	}

	public void setLevel(Short level) {
		this.level = level;
	}

	@Column(name = "score")
	public Integer getScore() {
		return this.score;
	}

	public void setScore(Integer score) {
		this.score = score;
	}

	@Column(name = "scoretimes")
	public Integer getScoretimes() {
		return this.scoretimes;
	}

	public void setScoretimes(Integer scoretimes) {
		this.scoretimes = scoretimes;
	}
	
	@Transient
	public double getAverageScore(){
		return score/new Double(scoretimes);
	}

}